<template>
	<view class="container">
		<view class="list-box">
			<view class="list-item" v-for="item in dataList" :key="item.studentMajorProbabilityId">
				<view class="list-item-name">{{item.enrollmentPlanMajorName}}</view>
				<view class="list-item-probability" v-if="item.studentMajorProbabilityProbability > 0">{{item.studentMajorProbabilityProbability}}</view>
				<view class="list-item-probability" v-else>-</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http,
		showToastMsg
	} from '../../utils'
	
	export default {
		data() {
			return {
				id: 0,
				dataList: []
			}
		},
		
		onLoad(options) {
			if (options.id) {
				this.id = options.id
			}
			this.fetchData()
		},
		
		methods: {
			
			fetchData() {
				const that = this
				http('/major-probability/list', {collegeId: that.id}).then(res => {
					if (res.code == 20000) {
						that.dataList = res.data
					}
				})
			}
			
		}
	}
</script>

<style>
	.container {
		width: 750rpx;
		height: auto;
	}
	
	.list-box {
		width: 750rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.list-item {
		width: 700rpx;
		height: 110rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid #f5f5f5;
	}
	
	.list-item-name {
		font-size: 28rpx;
		color: #666666;
	}
	
	.list-item-probability {
		font-size: 24rpx;
		color: #ff8806;
	}
</style>
